//
//  HttpClient.h
//  EduMobileTeacher
//
//  Created by zou tianyu on 13-8-19.
//  Copyright (c) 2013年 zou tianyu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFHTTPRequestOperationManager.h"
#import "ApiClient.h"
#import "CommonError.h"

//(void (^)(AFHTTPRequestOperation *operation, id responseObject))success

typedef void (^HttpClientSuccessBlock)(AFHTTPRequestOperation *operation, id responseObject);
typedef void (^HttpClientFailureBlock)(AFHTTPRequestOperation *operation, CommonError *error);

@interface HttpClient : NSObject


//普通的GET请求
+(void) getHttpRequest:(NSString *)uri
           withSuccess:(HttpClientSuccessBlock)success
           withFailure:(HttpClientFailureBlock)failure;

//普通的POST请求
+(void) postHttpRequest:(NSString *)method
              withParam:(NSDictionary *)paramRequest
            withSuccess:(HttpClientSuccessBlock)success
            withFailure:(HttpClientFailureBlock)failure;


//带图片的POST请求
+(void) postHttpRequest:(NSString *)method
              withParam:(NSDictionary *)paramRequest
          withImageData:(NSData *)imageData
        withUploadToken:(NSString *)token
           withFileName:(NSString *)filename
               withName:(NSString *)name
            withSuccess:(HttpClientSuccessBlock)success
            withFailure:(HttpClientFailureBlock)failure;

@end
